package com.usian.ai.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 候选人
 *
 * implements Serializable：实现序列化    ：避免序列化时出现异常
 */

@TableName("candidate")
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class Candidate implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    @TableField("id")
    private String id;

    /**
     * 真实姓名
     */
    @TableField("real_name")
    private String realName;

    /**
     * 应聘者身份证号码
     */

    @TableField("identity_num")
    private String identityNum;

    /**
     * 应聘者手机号
     */
    @TableField
    private String mobile;

    /**
     * 性别，1:男 0:女 2:保密
     */
    @TableField
    private Integer sex;

    /**
     * 应聘者照片
     */
    @TableField
    private String face;

    /**
     * 邮箱
     */
    @TableField
    private String email;

    /**
     * 生日
     */
    @TableField
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date birthday;

    /**
     * 国家
     */
    @TableField
    private String country;

    /**
     * 省份
     */
    @TableField
    private String province;

    /**
     * 城市
     */
    @TableField
    private String city;

    /**
     * 区县
     */
    @TableField
    private String district;

    /**
     * 地址
     */
    @TableField
    private String address;

    /**
     * 应聘职位的主键id
     */
    @TableField("job_id")
    private Integer jobId;

    /**
     * 备注信息
     */
    @TableField
    private String remark;

    /**
     * 创建时间
     */
    @TableField("created_time")
//    @JsonSerialize(using = LocalDateSerializer.class)
//    @JsonDeserialize(using = LocalDateDeserializer.class)
    private Date createdTime;

    /**
     * 更新时间
     */
    @TableField("updated_time")
    private Date updatedTime;


    @TableField(exist = false)
    String jobName;

}
